package com.woniuxy.user.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户操作日志表
 * </p>
 *
 * @author author
 * @since 2025-05-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("user_log")
@ApiModel(value="UserLog对象", description="用户操作日志表")
public class UserLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "日志ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "用户ID")
    private Integer userId;

    @ApiModelProperty(value = "用户名（可选）")
    private String userName;

    @ApiModelProperty(value = "操作类型，例如：登录、登出、浏览、下单、修改资料等")
    private String actionType;

    @ApiModelProperty(value = "操作描述，例如“用户修改了个人资料”")
    private String actionDesc;

    @ApiModelProperty(value = "用户IP地址")
    private String ipAddress;

    @ApiModelProperty(value = "用户浏览器或设备信息（user-agent）")
    private String userAgent;

    @ApiModelProperty(value = "访问的URL")
    private String requestUrl;

    @ApiModelProperty(value = "请求方式 GET/POST/PUT/DELETE")
    private String requestMethod;

    @ApiModelProperty(value = "是否成功（1成功，0失败）")
    private Integer successFlag;

    @ApiModelProperty(value = "失败原因（如有）")
    private String errorMsg;

    @ApiModelProperty(value = "操作时间")
    private LocalDateTime createTime;



}
